/* 信息 弹框 
 * @ 劳兆城 
 * @ 2017-07-26*/

<template>
	<Modal 
	class="info-model" 
	v-model="show" 
	@on-cancel="cancel" 
	:title="title">
		<slot></slot>
		<div slot="footer"></div>
	</Modal>
</template>

<script>
	
	export default {
		props: {
			title: {
				type: String,
				default: ''
			},
			isCancel: {
				type: Boolean,
				default: false
			}
		},
		data () {
			return {
				show: false
			}
		},
		methods: {
			showModel () {
				this.show = true
		},
			cancel () {
				if (!this.isCancel) {
					return
			}
				this.$emit('cancel')
		}
		}
	}
</script>

<style lang="scss">
	@import '~common/scss/color';
	
	.info-model {
		.ivu-modal {
			.ivu-modal-close {
				top: 4px;
				.ivu-icon-ios-close-empty {
					color: white;				
				}
			}
			.ivu-modal-close:hover {
				.ivu-icon-ios-close-empty {
					color: #999;				
				}
			}
			.ivu-modal-header {
				width: 100%;
				height: 40px;
				padding: 0;
				border: none;
				background-color: $color-default;
				border-top-left-radius: 6px;
				border-top-right-radius: 6px;
				overflow: hidden;
				.ivu-modal-header-inner {
					width: 100%;
					height: 100%;
					line-height: 40px;
					text-align: center;
					color: white;
				}
			}
			.ivu-modal-footer {
				padding: 0;
				border-top: none;
			}
		}
	}
</style>